package dto

import (
	"go-admin/app/admin/models"
	"go-admin/common/dto"
	common "go-admin/common/models"

	"time"
)

type SysMemberGoodsGetPageReq struct {
	dto.Pagination `search:"-"`
	Id             int       `form:"id"  search:"type:exact;column:id;table:sys_member_goods" comment:""`
	Category       string    `form:"category"  search:"type:exact;column:category;table:sys_member_goods" comment:"分类"`
	GoodsType      string    `form:"goodsType"  search:"type:exact;column:goods_type;table:sys_member_goods" comment:"商品大类"`
	GoodsModel     string    `form:"goodsModel"  search:"type:exact;column:goods_model;table:sys_member_goods" comment:"商品型号"`
	GoodsCode      string    `form:"goodsCode"  search:"type:exact;column:goods_code;table:sys_member_goods" comment:"商品编码"`
	GoodsName      string    `form:"goodsName"  search:"type:exact;column:goods_name;table:sys_member_goods" comment:"商品名称"`
	GoodsSpeci     string    `form:"goodsSpeci"  search:"type:exact;column:goods_speci;table:sys_member_goods" comment:"商品规格"`
	Remark         string    `form:"remark"  search:"type:exact;column:remark;table:sys_member_goods" comment:"备注"`
	Status         string    `form:"status"  search:"type:exact;column:status;table:sys_member_goods" comment:"业务状态"`
	IsDeleted      string    `form:"isDeleted"  search:"type:exact;column:is_deleted;table:sys_member_goods" comment:"删除状态"`
	CreateTime     time.Time `form:"createTime"  search:"type:exact;column:create_time;table:sys_member_goods" comment:"创建时间"`
	CreateAccount  string    `form:"createAccount"  search:"type:exact;column:create_account;table:sys_member_goods" comment:"创建人"`
	CreateOrg      string    `form:"createOrg"  search:"type:exact;column:create_org;table:sys_member_goods" comment:"创建部门"`
	UpdateAccount  string    `form:"updateAccount"  search:"type:exact;column:update_account;table:sys_member_goods" comment:"修改人"`
	UpdateTime     time.Time `form:"updateTime"  search:"type:exact;column:update_time;table:sys_member_goods" comment:"修改时间"`
	SysMemberGoodsOrder
}

type SysMemberGoodsOrder struct {
	Id            int       `form:"idOrder"  search:"type:order;column:id;table:sys_member_goods"`
	Category      string    `form:"categoryOrder"  search:"type:order;column:category;table:sys_member_goods"`
	GoodsType     string    `form:"goodsTypeOrder"  search:"type:order;column:goods_type;table:sys_member_goods"`
	GoodsModel    string    `form:"goodsModelOrder"  search:"type:order;column:goods_model;table:sys_member_goods"`
	GoodsCode     string    `form:"goodsCodeOrder"  search:"type:order;column:goods_code;table:sys_member_goods"`
	GoodsName     string    `form:"goodsNameOrder"  search:"type:order;column:goods_name;table:sys_member_goods"`
	GoodsSpeci    string    `form:"goodsSpeciOrder"  search:"type:order;column:goods_speci;table:sys_member_goods"`
	Remark        string    `form:"remarkOrder"  search:"type:order;column:remark;table:sys_member_goods"`
	Status        string    `form:"statusOrder"  search:"type:order;column:status;table:sys_member_goods"`
	IsDeleted     string    `form:"isDeletedOrder"  search:"type:order;column:is_deleted;table:sys_member_goods"`
	CreateTime    time.Time `form:"createTimeOrder"  search:"type:order;column:create_time;table:sys_member_goods"`
	CreateAccount string    `form:"createAccountOrder"  search:"type:order;column:create_account;table:sys_member_goods"`
	CreateOrg     string    `form:"createOrgOrder"  search:"type:order;column:create_org;table:sys_member_goods"`
	UpdateAccount string    `form:"updateAccountOrder"  search:"type:order;column:update_account;table:sys_member_goods"`
	UpdateTime    time.Time `form:"updateTimeOrder"  search:"type:order;column:update_time;table:sys_member_goods"`
}

func (m *SysMemberGoodsGetPageReq) GetNeedSearch() interface{} {
	return *m
}

type SysMemberGoodsInsertReq struct {
	Id            int       `json:"-" comment:""` //
	Category      string    `json:"category" comment:"分类"`
	GoodsType     string    `json:"goodsType" comment:"商品大类"`
	GoodsModel    string    `json:"goodsModel" comment:"商品型号"`
	GoodsCode     string    `json:"goodsCode" comment:"商品编码"`
	GoodsName     string    `json:"goodsName" comment:"商品名称"`
	GoodsSpeci    string    `json:"goodsSpeci" comment:"商品规格"`
	Remark        string    `json:"remark" comment:"备注"`
	Status        string    `json:"status" comment:"业务状态"`
	IsDeleted     string    `json:"isDeleted" comment:"删除状态"`
	CreateTime    time.Time `json:"createTime" comment:"创建时间"`
	CreateAccount string    `json:"createAccount" comment:"创建人"`
	CreateOrg     string    `json:"createOrg" comment:"创建部门"`
	UpdateAccount string    `json:"updateAccount" comment:"修改人"`
	UpdateTime    time.Time `json:"updateTime" comment:"修改时间"`
	common.ControlBy
}

func (s *SysMemberGoodsInsertReq) Generate(model *models.SysMemberGoods) {
	if s.Id == 0 {
		model.Model = common.Model{Id: s.Id}
	}
	model.Category = s.Category
	model.GoodsType = s.GoodsType
	model.GoodsModel = s.GoodsModel
	model.GoodsCode = s.GoodsCode
	model.GoodsName = s.GoodsName
	model.GoodsSpeci = s.GoodsSpeci
	model.Remark = s.Remark
	model.Status = s.Status
	model.IsDeleted = s.IsDeleted
	model.CreateAccount = s.CreateAccount
	model.CreateOrg = s.CreateOrg
	model.UpdateAccount = s.UpdateAccount
}

func (s *SysMemberGoodsInsertReq) GetId() interface{} {
	return s.Id
}

type SysMemberGoodsUpdateReq struct {
	Id            int    `uri:"id" comment:""` //
	Category      string `json:"category" comment:"分类"`
	GoodsType     string `json:"goodsType" comment:"商品大类"`
	GoodsModel    string `json:"goodsModel" comment:"商品型号"`
	GoodsCode     string `json:"goodsCode" comment:"商品编码"`
	GoodsName     string `json:"goodsName" comment:"商品名称"`
	GoodsSpeci    string `json:"goodsSpeci" comment:"商品规格"`
	Remark        string `json:"remark" comment:"备注"`
	Status        string `json:"status" comment:"业务状态"`
	IsDeleted     string `json:"isDeleted" comment:"删除状态"`
	CreateAccount string `json:"createAccount" comment:"创建人"`
	CreateOrg     string `json:"createOrg" comment:"创建部门"`
	UpdateAccount string `json:"updateAccount" comment:"修改人"`
	common.ControlBy
}

func (s *SysMemberGoodsUpdateReq) Generate(model *models.SysMemberGoods) {
	if s.Id == 0 {
		model.Model = common.Model{Id: s.Id}
	}
	model.Category = s.Category
	model.GoodsType = s.GoodsType
	model.GoodsModel = s.GoodsModel
	model.GoodsCode = s.GoodsCode
	model.GoodsName = s.GoodsName
	model.GoodsSpeci = s.GoodsSpeci
	model.Remark = s.Remark
	model.Status = s.Status
	model.IsDeleted = s.IsDeleted
	model.CreateAccount = s.CreateAccount
	model.CreateOrg = s.CreateOrg
	model.UpdateAccount = s.UpdateAccount
}

func (s *SysMemberGoodsUpdateReq) GetId() interface{} {
	return s.Id
}

// SysMemberGoodsGetReq 功能获取请求参数
type SysMemberGoodsGetReq struct {
	Id int `uri:"id"`
}

func (s *SysMemberGoodsGetReq) GetId() interface{} {
	return s.Id
}

// SysMemberGoodsDeleteReq 功能删除请求参数
type SysMemberGoodsDeleteReq struct {
	Ids []int `json:"ids"`
}

// Dm2cParams Dm2c平台请求参数
type Dm2cParams struct {
	AppCode  string
	PageNum  int
	PageSize int
}

type MemberGoodsResp struct {
	errCode   int
	requestId string
}

func (s *SysMemberGoodsDeleteReq) GetId() interface{} {
	return s.Ids
}
